/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.mqdemo3;

import java.io.File;
import java.io.IOException;

/**
 *
 * @author dell
 */
public class Demo {

    public static void main(String[] args) {
        int a=10/500;
        System.out.print(a);

    }

    public static void judeDirExists(File file) {
        if (file.exists()) {
            if (file.isDirectory()) {
                System.out.println("dir exists");
            }else {
            System.out.println("the same name file exists, can not create dir");
            }
        }else{
            System.out.println("dir not exists, create it ...");
            file.mkdirs();
        }
    }

    public static void FileExists(File file) {
        if (!file.exists()) {
            try {
                file.createNewFile();
                System.out.print("OK~");
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }

    }
}
